Setup
library(sf)
library(tidyverse)
library(rgeoboundaries)
library(osmextract)
library(tmap)
library(kableExtra)
library(lubridate)
library(DT)
hex_grid <- st_read("/Users/charlie/Downloads/hex_grid_join172.gpkg")
## Reading layer `hex_grid_join172' from data source
## `/Users/charlie/Downloads/hex_grid_join172.gpkg' using driver `GPKG'
## Simple feature collection with 688 features and 14 fields
## Geometry type: POLYGON
## Dimension: XY
## Bounding box: xmin: 36.65346 ymin: -1.457928 xmax: 37.11389 ymax: -1.138157
## Geodetic CRS: WGS 84
nairobi_roads <- st_read("/Users/charlie/WRI_Nairobi/data/semhol_diff.gpkg")
## Reading layer `semhol_diff' from data source
## `/Users/charlie/WRI_Nairobi/data/semhol_diff.gpkg' using driver `GPKG'
## Simple feature collection with 15929 features and 8 fields
## Geometry type: LINESTRING
## Dimension: XY
## Bounding box: xmin: 36.65535 ymin: -1.510086 xmax: 37.08296 ymax: -1.036557
## Geodetic CRS: WGS 84
Match between OSM and Uber road segments.
Total OSM road length for Nairobi.
OSM highway type coverage
Daily mean road speeds during the morning rush hour 6-9am with semester and holiday means and standard errors. Semester and holiday means and standard errors were calculated on all road speeds for all segments between the 6-9 am window for each respective period.
extreme20_days <- read_csv("data/extreme20_daysNairobi.csv")
print(extreme20_days)
## # A tibble: 20 × 2
## date mean_speed_kph
## <date> <dbl>
## 1 2019-12-27 42.4
## 2 2019-12-31 42.0
## 3 2019-01-02 41.6
## 4 2019-12-30 41.0
## 5 2019-12-24 38.6
## 6 2019-01-03 38.4
## 7 2019-12-23 37.9
## 8 2019-01-04 37.7
## 9 2019-08-26 35.8
## 10 2019-08-16 35.5
## 11 2019-12-03 30.5
## 12 2019-10-23 30.7
## 13 2019-01-29 30.8
## 14 2019-01-30 30.8
## 15 2019-12-10 31.0
## 16 2019-02-05 31.0
## 17 2019-06-06 31.1
## 18 2019-10-24 31.2
## 19 2019-11-26 31.2
## 20 2019-01-23 31.2
##Mean Road speeds by Road Type
Daily mean road speeds split by OSM highway type.